Repository navigation
markdown, components: images in MarkdownView from host bitmaps - #4
Merged
Merged
Conversation
The parser makes  a Span whose Image is the destination as written. MarkdownStyle.Image asks the application for each image's bitmap; the view lays it out inline, scaled down to the column and never up, makes a line as tall as its tallest image, keeps a linked image a link, and paints it. Without a bitmap the alt text shows, as before. The framework never reads files or the network. Closes the need of vivaui#220 in this fork. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1lck
added a commit
to 1lck/Lithe-IDEA
that referenced
this pull request
Nov 11, 2026
Viva's MarkdownView lays out images from bitmaps the application hands it (Lithe-IDEA/Lithe-viva#4). The preview resolves a destination relative to the file, or downloads an http(s) address through the proxy policy, decodes it off the window thread within the viewer's limits, and lays the page out again when it arrives; until then, and for formats the standard decoders do not read (SVG), the alt text shows. A linked badge stays a link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 of 15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the API proposed in vivaui#220 in our fork:
markdown.Span.Imageholds an image's destination as written ();Textis the alt text. A linked badge keeps itsLink.components.MarkdownStyle.Image func(destination string) (gfx.Bitmap, bool)resolves bitmaps; images lay out inline, scaled down to the column and never up. A line is as tall as its tallest image, and the image is painted withDrawBitmap. Without a resolver, or when it returns false, the alt text shows as before.Tests:
go test ./markdown ./components -run Image.🤖 Generated with Claude Code